<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const tema ={
        name : 'ojbk',
        members:[
            'a',
            'b',
            'c',
            'd'
        ],
        //给对象添加[Symbol.iterator]属性
        [Symbol.iterator](){
            var index = 0
            return {
                next(){
                let value =tema.members[index]
                let done =false
                if(index>=tema.members.length){
                    done = true
                }
                index++
                return {value ,done}
            }
            }
        }
    }


    //模拟迭代器
    // let iterator = tema[Symbol.iterator]()
    // console.log(iterator.next());

    </script>
</body>
</html>